import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(sum(a));
    }
    public static int sum(int n) {
        if(n < 10 ){
            return n;
        }
        return n%10 + sum(n/10);
    }
}
